//
//  SongListTableViewCell.m
//  XiMaLaYa
//
//  Created by dllo on 15/11/20.
//  Copyright © 2015年 L-G. All rights reserved.
//

#import "SongListTableViewCell.h"

@implementation SongListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.labelTitle = [[UILabel alloc] init];
        self.labelTitle.font = [UIFont systemFontOfSize:15];
        self.labelTitle.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.labelTitle];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.labelTitle.frame = CGRectMake(50, 12, self.frame.size.width - 70, 20);
}

- (void)setSongList:(SongList *)songList
{
    if (_songList != songList) {
        [_songList release];
        _songList = [songList retain];
    }
    self.labelTitle.text = songList.song_name;
}
+ (SongListTableViewCell *)songListTableViewCell:(UITableView *)tableView
{
    static NSString *cellIdentify = @"cellindex";
    SongListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentify];
    if (!cell) {
        cell = [[SongListTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentify];
    }

    return cell;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
